home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / misc-part1 / 5960 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: soap.news.pipex.net!pipex!usenet
  2. From: m.hendry@dial.pipex.com (Mathew Hendry)
  3. Newsgroups: comp.sys.amiga.misc
  4. Subject: Re: MUI 3.2
  5. Date: Thu, 15 Feb 96 02:05:26
  6. Organization: Private node.
  7. Distribution: world
  8. Message-ID: <19960215.477EF0.227C@ak156.du.pipex.com>
  9. References: <john.hendrikx.4d88@grafix.xs4all.nl> <9602110125.AA004i2@hectortd.demon.co.uk>
  10. NNTP-Posting-Host: ak156.du.pipex.com
  11. X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
  12.  
  13. Paul Copsey (paul@hectortd.demon.co.uk) wrote:
  14. : My env: contains 33226 bytes of files, but actually uses 138240 bytes
  15. : because of the way filesystems work. If I had Env: in Ram: (I use
  16. : statram, which has a block size of 512, as opposed to Ram:'s 1024)
  17. : then env: would swallow 247808 bytes.
  18. : Even a 1 byte file in ram: will take 1k to store.
  19.  
  20. I don't know where this idea keeps coming from. RAM: does NOT use a block
  21. system like floppy and hard disk filesystems (or StatRAM) - there is no need
  22. for it to do so, since RAM isn't organised in a "blocky" fashion.
  23.  
  24. Try executing this little script:
  25.  
  26. --- CUT HERE ---
  27.  
  28. .key blah
  29. .bra {
  30. .ket }
  31.  
  32. ; Damn, AmigaOS scripts are messy things ;)
  33.  
  34. set ctr 1
  35.  
  36. set endamount   `avail total` ; make sure all variables are set before trying
  37.                               ;   to get an exact figure.
  38. set startamount `avail total`
  39.  
  40. lab loop
  41.     echo >ram:testit_$ctr "0123456789" noline
  42.     set ctr `eval $ctr + 1`
  43. if val $ctr not gt 100
  44.     skip back loop
  45. endif
  46.  
  47. set endamount `avail total`
  48.  
  49. echo RAM consumed: `eval $startamount - $endamount`
  50.  
  51. delete >nil: ram:testit_#?
  52.  
  53. ---CUT HERE---
  54.  
  55. This script writes 100 10 byte files to RAM: (deleting them afterwards, of
  56. course).
  57.  
  58. The RAM used figure I get is 14400 bytes, or 144 bytes/file. 134 bytes/file
  59. isn't much of an overhead, and is certainly a lot less than that of StatRAM,
  60. which will "round up" file lengths to the next multiple of 512 bytes.
  61.  
  62. I'd imagine that most of the overhead here is due to RAM: using a fixed length
  63. filename field (altering the length of the filenames doesn't seem to alter the
  64. amount of RAM used). Protection bits, filenotes etc. must also be
  65. stored, which adds a bit more.
  66.  
  67. So, Paul, I'd recommend you move your ENV: assign to RAM:, to save a few of
  68. those precious bytes which StatRAM is stealing from you ;)
  69.  
  70. -- Mat.
  71.